<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
     /*    function deepClone(data){
            let clone=(Array.isArray(data))?[]:{};
            if(data && typeof data =="object"){
                for(key in data){
                    if(data.hasOwnProperty(key)){
                        if(data[key] && typeof data[key]==="object"){
                            clone[key]=deepClone(obj[key])
                        }else{
                            clone[key]=obj[key]
                        }
                    }
                } 
            }
            return clone  
        }
        let   obj={"a":1,"b":1,"c":2}
        let a=deepClone(obj);
        let b=obj;
        console.log(a) */
    /*     function deepClone(obj){
            let clone = Array.isArray(obj)?[]:{};
            if(obj && typeof obj ==="object"){
                for(key in obj){
                    if(obj.hasOwnProperty(key)){
                        if(obj[key] && typeof obj[key]==="object"){
                            clone[key] =deepClone(obj[key])
                        }else{
                            clone[key]=obj[key]
                        }
                    }
                }
            }
            return clone
        }
        let obj=deepClone({"a":1,"b":2,"c":{"a":1,"b":2}})
        console.log(obj) */


       /*  function deepClone(obj){
            let clone = Array.isArray(obj)?[]:{};
            if(obj && typeof obj ==="object"){
                for(key in obj){
                    if(obj.hasOwnProperty(key)){
                        if(obj[key] && typeof obj[key]==="object"){
                            clone[key]=deepClone(obj[key])
                        }else{
                            clone[key]=obj[key]
                        }
                    }
                }
            }
            return clone
        }
        let obj=deepClone({"a":1,"b":2,"c":{"a":1,"b":2}})
        console.log(obj) */
/* 
        function add(){

            var _args = Array.prototype.slice.call(arguments);
            console.log(_args)
            var _adder = function(){
                    _args.push(...arguments);
                    console.log("_adder",_args)
                    return _adder
            }
            _adder.toString=function(){
                return _args.reduce(function(a,b){
                    return a+b;
                })
            }
            return _adder;
        }
        console.log(Array.prototype)
        console.log(add(1)(2)); */

/* function add(){
    let _args=Array.prototype.slice.call(arguments);
    let _adder=function(){
        _args.push(...arguments);
        return _adder;
    }
    _adder.toString=function(){
        return _args.reduce(function(a,b){
            return a+b;
        })
    }
    return _adder
}
console.log(add(2)(3,4)(1)(4).toString()) */

</script>
</body>

</html>